<form class="download-remote-modal-form" role="form">
  <div class="modal-header">
    <button type="button" class="close" ng-click="close()">
      <span aria-hidden="true">&times;</span>
      <span class="sr-only">Close</span>
    </button>
    <h3 class="modal-title" translate="home.downloadRemote.headerLabel">Publish Pipeline</h3>
  </div>
  <div class="modal-body">

    <ng-include src="'app/home/alerts/error/errorAlert.tpl.html'"></ng-include>

    <table class="table">
      <thead>
      <tr>
        <th translate="home.downloadRemote.pipelineName">Pipeline Name</th>
        <th translate="home.downloadRemote.pipelineId">Pipeline ID</th>
        <th translate="home.downloadRemote.version">Version</th>
        <th translate="home.downloadRemote.commitMessage">Commit Message</th>
        <th translate="home.downloadRemote.actions">Actions</th>
      </tr>
      </thead>
      <tbody>
      <tr ng-repeat="remotePipeline in remotePipelines | orderBy:sortColumn:sortReverse">
        <td>{{remotePipeline.name}}</td>
        <td>{{remotePipeline.pipelineId}}</td>
        <td>{{remotePipeline.version}}</td>
        <td>{{remotePipeline.commitMessage}}</td>
        <td>
          <a href="javascript:;" translate="global.form.download"
             ng-if="!downloading[remotePipeline.commitId] && !downloaded[remotePipeline.commitId]"
             ng-click="downloadRemotePipeline(remotePipeline, $index); $event.stopPropagation()">Download</a>

          <span ng-if="downloaded[remotePipeline.commitId]">Downloaded</span>
          <span ng-if="downloading[remotePipeline.commitId]">Downloading ....</span>
        </td>
      </tr>

      <tr ng-if="remotePipelines.length === 0">
        <td colspan="5" class="no-records text-center"
            translate="home.downloadRemote.noPipelines">No Pipelines to view.</td>
      </tr>

      </tbody>
    </table>

    <ul class="properties clearfix">
      <li class="pull-right">
        <span class="properties-label">{{'home.publish.pipelineRepository' | translate}}: </span>
        <span class="properties-value">
          <a href="{{remoteBaseUrl}}" target="_blank">{{remoteBaseUrl}}</a>
        </span>
      </li>
    </ul>

  </div>
  <div class="modal-footer">
    <button type="reset" class="btn btn-default" ng-click="close()" translate="global.form.close">close</button>
  </div>
</form>
